import { reactive, ref } from "vue";

export default function InitHook() {
  const activeKey = ref<string>("-1");
  const tableRef = ref<any>(null);
  const pageStat = ref<Base.GeneraDataType>({
    "-1": 0,
    1: 0,
    5: 0,
    8: 0,
    9: 0,
    0: 0,
    "-2": 0
  });
  const searchForm = reactive<Partial<ClientWaybillManagement.SearchForm>>({
    countryRegionName: undefined,
    waybillNumList: "",
    startTime: undefined,
    createdTime: [],
    channelId: undefined,
    warehouseCode: undefined,
    remark: undefined,
    fbaNumberList: "",
    transferOrderNumberList: "",
    pageNum: 1,
    pageSize: 100,
    total: 0
  });
  const tableData = ref<Array<ClientWaybillManagement.ListRows>>([]);
  const drawerOpts = reactive<Base.DrawerOpts>({
    title: "",
    width: "520px",
    component: "",
    visible: false,
    type: 1,
    passData: {}
  });
  return {
    searchForm,
    tableData,
    drawerOpts,
    activeKey,
    pageStat,
    tableRef
  };
}
